<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="title">
		#{lang.getTrans("ui.mobile.service.situation.title")}
	</ui:define>
	<ui:define name="layoutCenter">
		<h:form>
			<p:growl id="growl" showDetail="true"/>
			<p:breadCrumb>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.home')}" url="/home.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.service.situation')}" url="/crud/serviceSituation/serviceSituationList.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.editar')}" url="/crud/serviceSituation/serviceSituationForm.xhtml"/>
			</p:breadCrumb>
			<p:panel id="panel" header="#{lang.getTrans('ui.mobile.service.situation.cadastre')}">
				
				<h:panelGrid columns="2">
					<h:outputLabel value="#{lang.getTrans('ui.mobile.service.situation.name')}"/>
					<p:inputText id="cdServiceSituation" required="true" size="50" maxlength="60"
						value="#{serviceSituationBean.serviceSituation.cdServiceSituation}"
						requiredMessage="#{lang.getTrans('ui.mobile.service.situation.name.obrigatorio')}">
					</p:inputText>

					<h:outputLabel value="#{lang.getTrans('ui.mobile.service.situation.descricao')}" />
					<p:inputTextarea rows="10" cols="50" id="dsServiceSituation" required="true"
						value="#{serviceSituationBean.serviceSituation.dsServiceSituation}"
						requiredMessage="#{lang.getTrans('ui.mobile.service.situation.descricao.obrigatorio')}" /> 
					
					<h:outputLabel value="#{lang.getTrans('ui.mobile.service.situation.color')}" />	
					<p:colorPicker id="dsPathItem" value="#{serviceSituationBean.serviceSituation.dsPathIcon}" widgetVar="picker"/>  
					
					<h:outputLabel value="#{lang.getTrans('ui.mobile.service.situation.state')}" />
					<p:selectOneMenu id="state" value="#{serviceSituationBean.serviceSituation.serviceState}" required="true"
						requiredMessage="#{lang.getTrans('ui.mobile.service.situation.state.obrigatorio')}">
						<f:selectItem itemLabel="Selecione" itemValue="" />
						<f:selectItems value="#{serviceSituationBean.servicesStates}" />
						<f:converter converterId="servicesStates"/>
					</p:selectOneMenu>

				</h:panelGrid>
			</p:panel>
			<p:blockUI block="panel" trigger="btInsert"/>
			<p:panel style="text-align:center">
				<h:inputHidden id="idServiceSituation" value="#{serviceSituationBean.serviceSituation.idServiceSituation}" />
				<h:inputHidden id="nrVersion" value="#{serviceSituationBean.serviceSituation.nrVersion}" />
				<p:commandButton id="btInsert" value="#{lang.getTrans('ui.mobile.common.save')}"
					type="submit" action="#{serviceSituationBean.adicionar}" update="growl"/>
				<p:button value="#{lang.getTrans('ui.mobile.common.cancel')}" outcome="serviceSituationList" />
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
